package com.alibaba.demo.service.convertor;

import com.alibaba.demo.domain.service.entity.IotServiceEntity;
import com.alibaba.demo.service.dataobject.IotServiceDO;

/**
 * @author Administrator
 * @date 2024/4/28 11:27
 * @description
 */
public class IotServiceConvertor {

    public static IotServiceDO toDO(IotServiceEntity iotServiceEntity) {
        IotServiceDO iotServiceDO = new IotServiceDO();
        iotServiceDO.setId(iotServiceEntity.getId());
        iotServiceDO.setMqttUser(iotServiceEntity.getMqttUser());
        iotServiceDO.setMqttServiceName(iotServiceEntity.getMqttServiceName());
        iotServiceDO.setType(iotServiceEntity.getType());
        iotServiceDO.setMqttDomain(iotServiceEntity.getMqttDomain());
        iotServiceDO.setMqttPort(iotServiceEntity.getMqttPort());
        iotServiceDO.setMqttPwd(iotServiceEntity.getMqttPwd());
        iotServiceDO.setPlatformUrl(iotServiceEntity.getPlatformUrl());
        return iotServiceDO;
    }

    public static IotServiceEntity toEntity(IotServiceDO iotServiceDO) {
        IotServiceEntity iotServiceEntity = new IotServiceEntity();
        iotServiceEntity.setId(iotServiceDO.getId());
        iotServiceEntity.setMqttUser(iotServiceDO.getMqttUser());
        iotServiceEntity.setMqttServiceName(iotServiceDO.getMqttServiceName());
        iotServiceEntity.setType(iotServiceDO.getType());
        iotServiceEntity.setMqttDomain(iotServiceDO.getMqttDomain());
        iotServiceEntity.setMqttPort(iotServiceDO.getMqttPort());
        iotServiceEntity.setMqttPwd(iotServiceDO.getMqttPwd());
        iotServiceEntity.setPlatformUrl(iotServiceDO.getPlatformUrl());
        return iotServiceEntity;
    }
}
